package builder;

import java.util.Vector;

import model.Action;

public class ObserverBuilder extends AbstractPatternBuilder {

	private String subject = "Subject";
	private String concreteSubject = "ConcreteSubject";
	private String observer = "Observer";
	private String concreteObserver = "ConcreteObserver";
	
	public ObserverBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(concreteSubject);	
		this.buildClass(concreteObserver);
			
		this.buildAbstractClass(subject);	
		this.buildAbstractClass(observer);
		
		this.buildGeneralization(concreteSubject, subject);
		this.buildGeneralization(concreteObserver, observer);
		
		this.buildAssociation(subject, observer);
		this.buildAssociation(concreteObserver, concreteSubject);
			
		return patternActions;
	}

	@Override
	public void changeNames() {

		subject = names.get(0);
		concreteSubject = names.get(1);
		observer = names.get(2);
		concreteObserver = names.get(3);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 4;
	}

}
